﻿using QG.FrontDesk.BLL.IService;
using QG.FrontDesk.DAL.IRepository;
using QG.FrontDesk.Model;
using System.Collections.Generic;

namespace QG.FrontDesk.BLL.Service
{
    public class CompanyService : ICompanyService
    {
        private ICompanyRepository companyRepository;

        public CompanyService(ICompanyRepository companyRepository)
        {
            this.companyRepository = companyRepository;
        }
        /// <summary>
        /// 新增注册公司
        /// </summary>
        /// <param name="company"></param>
        /// <returns></returns>
        public int AddCompany(Company company)
        {
            return companyRepository.AddCompany(company);
        }
        /// <summary>
        /// 完善公司信息
        /// </summary>
        /// <param name="company"></param>
        /// <returns></returns>
        public int UpdateCompany(Company company)
        {
            return companyRepository.UpdateCompany(company);
        }
        /// <summary>
        /// 完善公司创始人团队
        /// </summary>
        /// <param name="compId"></param>
        /// <param name="foundTeams"></param>
        /// <returns></returns>
        public int UpdateCompanyFound(List<FoundTeam> foundTeams)
        {
            return companyRepository.UpdateCompanyFound(foundTeams);
        }
        /// <summary>
        /// 完善公司产品信息
        /// </summary>
        /// <param name="CompId"></param>
        /// <param name="productInfos"></param>
        /// <returns></returns>
        public int UpdateCompanyProduct(List<ProductInfo> productInfos)
        {
            return companyRepository.UpdateCompanyProduct(productInfos);
        }
        /// <summary>
        /// 完善公司介绍
        /// </summary>
        /// <param name="remark"></param>
        /// <returns></returns>
        public int UpdateCompanyRemark(int CompId, string remark)
        {
            return companyRepository.UpdateCompanyRemark(CompId,remark);
        }

        /// <summary>
        /// 完善公司标签
        /// </summary>
        /// <param name="company"></param>
        /// <returns></returns>
        public int UpdateCompanyTabel(int compId, string[] labels)
        {
            return companyRepository.UpdateCompanyTabel(compId, labels);
        }

        /// <summary>
        /// 得到公司信息
        /// </summary>
        /// <param name="compId"></param>
        /// <returns></returns>
        public Company GetCompanyInfo(int compId) {            
            return companyRepository.GetCompanyInfo(compId);
        }
        /// <summary>
        /// 更改详情页标签
        /// </summary>
        /// <param name="companyId"></param>
        /// <param name="labels"></param>
        /// <returns></returns>
        public int UpdateLabelaByDetails(int companyId, string[] labels)
        {
            return companyRepository.UpdateLabelaByDetails(companyId, labels);            
        }
        /// <summary>
        /// 得到所有公司信息
        /// </summary>
        /// <returns></returns>
        public List<Company> GetCompanyList(string fs, string ifs,string city)
        {
            return companyRepository.GetCompanyList(fs,ifs, city);
        }
        /// <summary>
        /// 修改公司地址,主页,规模
        /// </summary>
        /// <param name="CityName"></param>
        /// <param name="company"></param>
        /// <returns></returns>
        public int UpdateCityIndustryByDetails(Company company)
        {
            return companyRepository.UpdateCityIndustryByDetails(company);
        }

        public int UpdateCityRemarkByDetails(Company company) {
            return companyRepository.UpdateCityRemarkByDetails(company);
        }
        /// <summary>
        /// 修改公司产品
        /// </summary>
        /// <param name=""></param>
        /// <returns></returns>
        public int UpdateProductByDetails(ProductInfo productInfo) {
            return companyRepository.UpdateProductByDetails(productInfo);
        }
        /// <summary>
        /// 设置密码
        /// </summary>
        /// <param name="password"></param>
        /// <param name="compId"></param>
        /// <returns></returns>
        public int UpdatePwd(string password, int compId) {
            return companyRepository.UpdatePwd(password,compId);
        }

        /// <summary>
        /// 公司登录
        /// </summary>
        /// <param name="Email"></param>
        /// <param name="pwd"></param>
        /// <returns></returns>
        public Company GetCompany(string Email, string pwd) {
            return companyRepository.GetCompany(Email,pwd);
        }
    }
}
